package com.hopu.blb_erp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hopu.blb_erp.mapper.FunctionsMapper;
import com.hopu.blb_erp.entity.Functions;
import com.hopu.blb_erp.service.FunctionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FunctionsServiceImpl implements FunctionsService {

    @Autowired
    private FunctionsMapper functionsMapper;

    @Override
    public List<Functions> findByName(String username) {
        return functionsMapper.selectByName(username);
    }

    @Override
    public List<Functions> findById(String id) {
        return functionsMapper.selectById(id);
    }

    @Override
    public List<Functions> findAll() {
        return functionsMapper.selectAll();
    }

    @Override
    public Integer findCount() {
        return functionsMapper.selectCount();
    }

    @Override
    public List<Functions> findPage(Integer current, Integer pageSize) {
        return functionsMapper.selectPage(current, pageSize);
    }

    @Override
    public void add(Functions functions) {
        functionsMapper.insert(functions);
    }

    @Override
    public void removeById(String id) {
        functionsMapper.deleteById(id);
    }

    @Override
    public void modifyById(Functions functions) {
        functionsMapper.updateById(functions);
    }

    @Override
    public Functions findId(String id) {
        return functionsMapper.selectId(id);
    }
}
